<template>
	<view>
		<view class="register">
			<uni-forms :modelValue="regisForm">
				<uni-forms-item>
					<uni-easyinput prefixIcon="search" v-model="regisForm.name" placeholder="用户昵称" @iconClick="onClickUserName"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item>
					<uni-easyinput prefixIcon="search" v-model="regisForm.account_num" placeholder="请输入QQ号" @iconClick="onClickUserName"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item>
					<uni-easyinput prefixIcon="search" v-model="regisForm.phone" placeholder="请输入手机号" @iconClick="onClickUserName"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item>
					<uni-easyinput prefixIcon="search" v-model="regisForm.password" placeholder="请输入密码" @iconClick="onClickUserName"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item>
					<uni-easyinput prefixIcon="search" v-model="regisForm.re_password" placeholder="请再次输入密码" @iconClick="onClickUserName"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item>
					<uni-easyinput prefixIcon="search" v-model="regisForm.invite_code" placeholder="邀请码(非必填)" @iconClick="onClickUserName"></uni-easyinput>
				</uni-forms-item>
			</uni-forms>
			<button type="primary" @click="register">注册</button>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad(){
			var my=this.encryptDes();
			this.APP_scode=my.APP_scode
		},
		data() {
			return {
				regisForm:{
					name:'',
					account_num:'',
					phone:'',
					password:'',
					re_password:'',
					invite_code:'',
				},
				APP_scode:''
			};
		},
		methods:{
			async register(){
				// uni.request({
				// 	url:'https://wemall.minephone.com/openTask/qq_operTask/backend/public/index.php/api/Ajaxapi/registers',
				// 	method:'POST',
				// 	data:this.regisForm,
				// 	header:{
				// 		"Content-Type": "application/json",
				// 		"App-Key":'87fce399d54e92a1d93b09d49a9da273',
				// 		"App-Scode":this.APP_scode
				// 	},
				// 	success:(res=>{
				// 		console.log(res)
				// 	})
				// })
				var res=await this.$request({url:'/registers',data:this.regisForm,methods:'POST',header:this.APP_scode})
				console.log(res)
			}
		}
	}
</script>

<style lang="scss">
	.register{
		padding: 5%;
		button{
			background-color: #4CD964;
			line-height: 80rpx;
			font-size: 32rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 0;
			margin-top: 80rpx;
		}
	}
</style>
